package test8;

import com.tyfspring.context.support.ClassPathXmlApplicationContext;
import org.junit.Test;

/**
 * @Description TODO
 * @Author shallow
 * @Date 2023/4/10 20:57
 */

public class test {
    @Test
    public void test(){
        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath:test8/spring.xml");
        classPathXmlApplicationContext.registerShutdownHook();
        //获取bean对象调用方法
        UserService userService = classPathXmlApplicationContext.getBean("userService", UserService.class);
        String result = userService.queryUserInfo();
        System.out.println("结果"+result);
    }
}
